Skip to content

#192 - Add eCPRI matching#193

Merged
cliffburdick merged 3 commits into
mainfrom
ecpri-rx-flow-matching
Jun 30, 2026
Merged

#192 - Add eCPRI matching#193
cliffburdick merged 3 commits into
mainfrom
ecpri-rx-flow-matching

Conversation

@cliffburdick

Copy link
Copy Markdown
Collaborator

Add eCPRI-over-Ethernet (EtherType 0xAEFE) as a new RX flow-match class in both the DPDK and ibverbs engines, alongside the existing standard UDP/IP and flex-item classes.

Config: new FlowMatchType::ECPRI and EcpriMatch (optional message type + pc_id/rtc_id); selected by a match.ecpri map in YAML. Matching the identifier requires a msg_type (hardware constraint).

DPDK: add_ecpri_flow() builds an ETH(0xAEFE)+RTE_FLOW_ITEM_TYPE_ECPRI pattern in a dedicated flow group (2) with its own group-0 jump rule and send-to-kernel fallback; validate_config() now enforces three-way mutual exclusivity of flow classes.

ibverbs: a per-port mlx5 flex-parser node anchored at L2 on the eCPRI EtherType samples the common-header and message-body dwords, matched via misc_parameters_4; wired into static and dynamic flow installation and teardown.

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces eCPRI-over-Ethernet (EtherType 0xAEFE) as a third RX flow-match class alongside existing UDP/IP and flex-item classes, wired through both the DPDK and ibverbs engines with proper config parsing, validation, teardown, and doc updates.

  • DPDK: add_ecpri_flow() places the ETH+RTE_FLOW_ITEM_TYPE_ECPRI pattern in a dedicated group 2 with its own group-0 jump rule; initialize() auto-switches eCPRI interfaces to dv_flow_en=1 (firmware steering) since HW steering silently drops the item; validate_dynamic_rx_flow() rejects dynamic eCPRI flows on ports that never received a static eCPRI flow.
  • ibverbs: a lazily-created per-port FLEX_PARSE_GRAPH node anchored at MAC/eCPRI EtherType samples the common-header dword (message type) and body dword (pc_id/rtc_id), torn down in the established flex-node-after-rules order.
  • Config/validation: EcpriMatch and FlowMatchType::ECPRI are new public types; three-way mutual-exclusivity is enforced in both engines.

Confidence Score: 5/5

Safe to merge; the eCPRI matching logic, teardown order, and firmware-steering guard are all sound, with only minor process housekeeping outstanding.

The functional code is well-structured: the DPDK firmware-steering auto-switch, three-way exclusivity enforcement, ibverbs flex-parser node lifecycle, and dynamic-flow guard all follow established patterns in the codebase. The only findings are a missing issue-number prefix on one commit title and five doc pages that should be updated alongside the public-type and engine changes — neither affects runtime correctness.

No files require special attention for correctness. The doc-sync gaps span docs/api-guide.md, docs/daqiri-api.html, README.md, docs/getting-started.md, and docs/tutorials/configuration-walkthrough.md.

Important Files Changed

Filename Overview
AGENTS.md Updated engine paragraphs to describe eCPRI group 2, firmware-steering trade-off, and ibverbs flex-parser matching; accurate and consistent with code changes.
docs/api-reference/configuration.md Added ecpri YAML block docs, updated three-way mutual exclusivity prose and flow-isolation section; consistent with implementation.
docs/benchmarks/raw_benchmarking.md Added eCPRI smoke-test row and updated mixed-flow row to reference all three flow classes.
include/daqiri/types.h Adds EcpriMatch struct and FlowMatchType::ECPRI enum value; match_id_ implies match_msg_type_ constraint is documented and enforced at parse and validate layers.
src/common.cpp YAML parser detects match.ecpri map, fills EcpriMatch, and returns early on constraint violation; correctly placed before the UDP/IP fallback path.
src/engines/dpdk/daqiri_dpdk_engine.cpp Adds add_ecpri_flow() with firmware-steering switch, three-way exclusivity in validate_config(), HW-steering guard in validate_dynamic_rx_flow(), and static/legacy-dynamic hooks. MAX_PATTERN_NUM=16 is well above the 3-item pattern used.
src/engines/dpdk/daqiri_dpdk_engine.h Adds add_ecpri_flow() declaration; consistent with existing flow-method signatures.
src/engines/ibverbs/daqiri_ibverbs_engine.cpp Adds create_ecpri_parser_node() and build_ecpri_match_locked(); teardown in shutdown() correctly follows flex-node-after-rules order.
src/engines/ibverbs/daqiri_ibverbs_engine.h Adds EcpriNode struct to PortSteering and declares new methods; consistent with existing FlexNode/ipv4_len_node pattern.
src/engines/ibverbs/mlx5_prm_min.h Adds MLX5_ETHERTYPE_ECPRI = 0xAEFE alongside existing EtherType constants; minimal and correct.

Reviews (6): Last reviewed commit: "#192 - Reject dynamic eCPRI RX flows on ..." | Re-trigger Greptile

Comment thread src/engines/dpdk/daqiri_dpdk_engine.cpp
@cliffburdick cliffburdick force-pushed the ecpri-rx-flow-matching branch from d1702da to ac7dcdf Compare June 16, 2026 23:35
…ss in both the DPDK and ibverbs engines, alongside the existing standard UDP/IP and flex-item classes.

Config: new FlowMatchType::ECPRI and EcpriMatch (optional message type + pc_id/rtc_id); selected by a match.ecpri map in YAML. Matching the identifier requires a msg_type (hardware constraint).

DPDK: add_ecpri_flow() builds an ETH(0xAEFE)+RTE_FLOW_ITEM_TYPE_ECPRI pattern in a dedicated flow group (2) with its own group-0 jump rule and send-to-kernel fallback; validate_config() now enforces three-way mutual exclusivity of flow classes.

ibverbs: a per-port mlx5 flex-parser node anchored at L2 on the eCPRI EtherType samples the common-header and message-body dwords, matched via misc_parameters_4; wired into static and dynamic flow installation and teardown.
Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
The mlx5 PMD honors the native eCPRI flow item (RTE_FLOW_ITEM_TYPE_ECPRI) only under firmware steering (dv_flow_en=1); under HW steering (dv_flow_en=2, the engine default) the rule installs but never matches on ConnectX-class NICs.

initialize() now auto-switches any interface carrying eCPRI RX flows to dv_flow_en=1 and logs a warning. Other interfaces keep dv_flow_en=2. Trade-off: the async/template dynamic-RX-flow path (which needs HW steering) is unavailable on an eCPRI interface.

Validated on ConnectX-7: DAQIRI TX (raw eCPRI frames) -> DAQIRI RX steers each (msg_type, pc_id) variant to the correct queue with the correct per-packet flow id, on both the dpdk (dv_flow_en=1) and ibverbs engines.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
validate_dynamic_rx_flow() accepted eCPRI flows without checking the port's steering mode. initialize() switches a port to firmware steering (dv_flow_en=1) only when it has a static eCPRI flow; on a HW-steering (dv_flow_en=2) port add_ecpri_flow() returns success but the mlx5 PMD silently never matches the eCPRI item, so packets bypass the queue with no error.

Require at least one static eCPRI flow on the interface (the only signal that initialize() picked firmware steering) before accepting a dynamic eCPRI flow. The ibverbs engine has no such dependency and is unaffected.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
@cliffburdick cliffburdick force-pushed the ecpri-rx-flow-matching branch from ac7dcdf to befef50 Compare June 30, 2026 18:07
@cliffburdick cliffburdick merged commit 0c7903d into main Jun 30, 2026
3 checks passed
@cliffburdick cliffburdick deleted the ecpri-rx-flow-matching branch June 30, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant